<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>出版社详情</title>
    <link rel="stylesheet" href="/element-ui/index.css">
    <link rel="stylesheet" href="/element-ui/fonts/element-icons.css">
    <script src="/element-ui/vue.js"></script>
    <script src="/element-ui/index.js"></script>
    <script src="/element-ui/axios.min.js"></script>
    <style>
        body {
            font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', '\\5FAE\\8F6F\\96C5\\9ED1', Arial, sans-serif;
            background-color: #f5f6fa;
        }
        #app {
            padding: 20px;
            background-color: #f5f6fa;
        }
        .page-title {
            font-size: 26px;
            font-weight: bold;
            color: #333;
            background: #fff;
            padding: 24px 20px 12px 20px;
            border-bottom: 1px solid #eee;
            margin-bottom: 20px;
            letter-spacing: 2px;
            text-align: center;
            animation: fadeInDown 0.8s ease-out;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
            border-radius: 8px;
        }
        @keyframes fadeInDown {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        .el-main {
            padding: 20px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.05);
        }
        .el-button {
            transition: all 0.3s ease;
        }
        .el-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 10px rgba(0,0,0,0.1);
        }
        .el-descriptions-item__label {
            font-weight: bold;
            color: #606266;
        }
        .el-descriptions-item__content {
            color: #303133;
        }
        .el-descriptions {
            animation: fadeIn 1s ease-out;
        }
        @keyframes fadeIn {
            from { opacity: 0; }
            to { opacity: 1; }
        }
    </style>
</head>
<body>
    <div id="app">
        <div class="page-title">出版社详情</div>
        <el-container>
            <el-main>
                <el-descriptions title="" :column="1" border>
                    <el-descriptions-item label="出版社名称">{{publisher.name}}</el-descriptions-item>
                    <el-descriptions-item label="地址">{{publisher.address}}</el-descriptions-item>
                    <el-descriptions-item label="联系人">{{publisher.contact}}</el-descriptions-item>
                    <el-descriptions-item label="联系电话">{{publisher.phone}}</el-descriptions-item>
                    <el-descriptions-item label="创建时间">{{publisher.createTime ? publisher.createTime.replace('T', ' ') : ''}}</el-descriptions-item>
                    <el-descriptions-item label="更新时间">{{publisher.updateTime ? publisher.updateTime.replace('T', ' ') : ''}}</el-descriptions-item>
                </el-descriptions>
                <div style="margin-top: 30px;">
                    <el-button @click="goBack">返回</el-button>
                </div>
            </el-main>
        </el-container>
    </div>
    <script>
        new Vue({
            el: '#app',
            data() {
                return {
                    publisher: {}
                }
            },
            created() {
                const pathParts = window.location.pathname.split('/');
                this.id = pathParts[pathParts.length - 1];
                this.fetchDetail();
            },
            methods: {
                fetchDetail() {
                    axios.get(`/publisher/detail/${this.id}`)
                        .then(response => {
                            this.publisher = response.data.publisher;
                        })
                        .catch(error => {
                            this.$message.error('获取出版社信息失败');
                        });
                },
                goBack() {
                    window.location.href = '/publisher/list';
                }
            }
        });
    </script>
</body>
</html> 